package com.orangelife.webservice.service.propFeeAccount;

import java.util.List;
import java.util.Map;

import javax.jws.WebParam;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import org.apache.cxf.jaxrs.ext.multipart.Attachment;

import com.orangelife.exception.AppBizException;
import com.orangelife.service.propFeeAccount.model.PropFeeAccountDto;

public interface IPropFeeAccountWebService {

	/**
	 * 功能：获取房屋的可使用预交款
	 * 
	 * @param request
	 * @param apartmentID
	 * @param commID
	 * @return
	 * @throws Exception
	 * */
	@GET
	@Path("/getPreAmount")
	@Produces({ "application/json" })
	public Response getAmonutByApartmentID(@Context HttpServletRequest request,
			@QueryParam("commID") String commID,
			@QueryParam("apartmentID") String apartmentID) throws Exception,
			AppBizException;

	/**
	 * 用途 添加 （橙子生活）
	 * 
	 * @author zhr
	 * @date创建时间 2016-07-31 16:45:04
	 * @param servletRequest
	 * @param propFeeAccount
	 * @return
	 * @throws Exception
	 */

	@POST
	@Path("/add")
	@Produces({ "application/json" })
	public Response addPropFeeAccount(
			@Context HttpServletRequest servletRequest,
			@WebParam PropFeeAccountDto propFeeAccount) throws Exception;

	/**
	 * 用途 修改（橙子生活）
	 * 
	 * @author zhr
	 * @date创建时间 2016-07-31 16:45:04
	 * @param servletRequest
	 * @param propFeeAccount
	 * @return
	 * @throws Exception
	 */
	@PUT
	@Path("/edit")
	@Produces({ "application/json" })
	public Response editPropFeeAccount(
			@Context HttpServletRequest servletRequest,
			@WebParam PropFeeAccountDto propFeeAccount) throws Exception;

	/**
	 * 用途 删除（橙子生活）
	 * 
	 * @date 创建时间 2016-07-31 16:45:04
	 * @author zhr
	 * @param servletRequest
	 * @param accountID
	 * @return
	 * @throws Exception
	 */
	@DELETE
	@Path("{accountID}")
	@Produces({ "application/json" })
	public Response deletePropFeeAccount(
			@Context HttpServletRequest servletRequest,
			@PathParam("accountID") String accountID) throws Exception;

	/**
	 * 用途 详情（橙子生活）
	 * 
	 * @date 创建时间 2016-07-31 16:45:04
	 * @author zhr
	 * @param servletRequest
	 * @param accountID
	 * @return
	 * @throws Exception
	 */
	@GET
	@Path("{accountID}/")
	@Produces({ "application/json" })
	public Response findPropFeeAccountByID(
			@Context HttpServletRequest servletRequest,
			@PathParam("accountID") String accountID) throws Exception;

	/**
	 * 用途 查询列表（橙子生活）
	 * 
	 * @author zhr
	 * @date 创建时间 2016-07-31 16:45:04
	 * @param servletRequest
	 * @param search
	 *            搜索内容
	 * @param tsCreate
	 *            创建时间
	 * @param pageIndex
	 *            页码
	 * @param pageSize
	 *            页面大小
	 * @return
	 * @throws Exception
	 */
	@GET
	@Produces({ "application/json" })
	public Response getAllPropFeeAccount(
			@Context HttpServletRequest servletRequest,
			@QueryParam("commID") String commID,
			@QueryParam("search") String search,
			@QueryParam("tsCreate") String tsCreate,
			@QueryParam("pageIndex") String pageIndex,
			@QueryParam("pageSize") String pageSize) throws Exception;

	@GET
	@Path("{accountID}/logInfos")
	@Produces({ "application/json" })
	public Response getAccountlogs(@Context HttpServletRequest servletRequest,
			@PathParam("accountID") String accountID,
			@QueryParam("operation") String operation,
			@QueryParam("logType") String logType,
			@QueryParam("search") String search,
			@QueryParam("tsCreate") String tsCreate,
			@QueryParam("pageIndex") String pageIndex,
			@QueryParam("pageSize") String pageSize) throws Exception;

	/**
	 * 用途 查询列表（橙子生活）
	 * 
	 * @author zhr
	 * @date 创建时间 2016-07-31 16:45:04
	 * @param servletRequest
	 * @param search
	 *            搜索内容
	 * @param tsCreate
	 *            创建时间
	 * @param pageIndex
	 *            页码
	 * @param pageSize
	 *            页面大小
	 * @return
	 * @throws Exception
	 */

	@POST
	@Path("/bauthfinds")
	@Produces({ "application/json" })
	public Response bauthFindPropFeeAccounts(
			@Context HttpServletRequest servletRequest,
			@WebParam Map<String, Object> propFeeAccount) throws Exception;

	/**
	 * 用途 查询列表（橙子生活）
	 * 
	 * @author zhr
	 * @date 创建时间 2016-07-31 16:45:04
	 * @param servletRequest
	 * @param search
	 *            搜索内容
	 * @param tsCreate
	 *            创建时间
	 * @param pageIndex
	 *            页码
	 * @param pageSize
	 *            页面大小
	 * @return
	 * @throws Exception
	 */

	@POST
	@Path("/bauthfind")
	@Produces({ "application/json" })
	public Response bauthFindPropFeeAccount(
			@Context HttpServletRequest servletRequest,
			@WebParam List<String> propFeeAccount) throws Exception;

	/***
	 * 清除缓存
	 * 
	 * @param request
	 * @param response
	 * @return
	 * @throws AppBizException
	 */
	@GET
	@Path("clearCache")
	@Produces({ "application/json" })
	public Response clearCache(@Context HttpServletRequest request,
			@Context HttpServletResponse response) throws Exception;

	@GET
	@Path("downAccount")
	@Consumes({ "application/json" })
	@Produces(MediaType.APPLICATION_OCTET_STREAM)
	public Response downRecord(@Context HttpServletRequest servletRequest,
			@Context HttpServletResponse servletResponse,
			@QueryParam("search") String search,
			@QueryParam("commID") String commID, @QueryParam("comm") String comm)
			throws Exception;

	/***
	 * 导入表初始化的数据
	 * 
	 * @param servletRequest
	 * @param servletResponse
	 * @param attachments
	 * @return
	 * @throws Exception
	 */
	@POST
	@Path("/importAccount")
	@Consumes({ "multipart/form-data" })
	@Produces({ "application/json" })
	public Response ImportAccount(@Context HttpServletRequest servletRequest,
			@Context HttpServletResponse servletResponse,
			@QueryParam("commID") String commID,
			@QueryParam("accessToken") String accessToken,
			List<Attachment> attachments) throws Exception;

	/****
	 * 导入日志
	 * 
	 * @param servletRequest
	 * @param commID
	 * @param search
	 * @param tsCreate
	 * @param pageIndex
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	@GET
	@Path("logInfos")
	@Produces({ "application/json" })
	public Response getAccountImportlogs(
			@Context HttpServletRequest servletRequest,
			@QueryParam("commID") String commID,
			@QueryParam("search") String search,
			@QueryParam("tsCreate") String tsCreate,
			@QueryParam("pageIndex") String pageIndex,
			@QueryParam("pageSize") String pageSize) throws Exception;

	/***
	 * 查询房屋鱼儿
	 * 
	 * @param servletRequest
	 * @param commID
	 * @param searchType
	 * @param search
	 * @param startTime
	 * @param pageIndex
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	@GET
	@Path("accountInfos")
	@Produces({ "application/json" })
	public Response getAllPropFeeAccountInfo(
			@Context HttpServletRequest servletRequest,
			@QueryParam("commID") String commID,
			@QueryParam("apartmentType") String apartmentType,
			@QueryParam("searchType") String searchType,
			@QueryParam("search") String search,
			@QueryParam("startTime") String startTime,
			@QueryParam("pageIndex") String pageIndex,
			@QueryParam("pageSize") String pageSize) throws Exception;

	@GET
	@Path("{accountID}/accountlogInfos")
	@Produces({ "application/json" })
	public Response getAccountInfologs(
			@Context HttpServletRequest servletRequest,
			@PathParam("accountID") String accountID,
			@QueryParam("operation") String operation,
			@QueryParam("logType") String logType,
			@QueryParam("search") String search,
			@QueryParam("tsCreate") String tsCreate,
			@QueryParam("pageIndex") String pageIndex,
			@QueryParam("pageSize") String pageSize) throws Exception;

	@GET
	@Path("{accountID}/accountlogs")
	@Produces({ "application/json" })
	public Response accountlogs(
			@Context HttpServletRequest servletRequest,
			@PathParam("accountID") String accountID,
			@QueryParam("operation") String operation,
			@QueryParam("logType") String logType,
			@QueryParam("search") String search,
			@QueryParam("tsCreate") String tsCreate,
			@QueryParam("pageIndex") String pageIndex,
			@QueryParam("pageSize") String pageSize) throws Exception;
	
	/***
	 * 导出房屋账户余额
	 * 
	 * @param servletRequest
	 * @param servletResponse
	 * @param commID
	 * @param comm
	 * @param apartmentType
	 * @param searchType
	 * @param search
	 * @param startTime
	 * @return
	 * @throws Exception
	 */
	@GET
	@Path("exportAccount")
	@Consumes({ "application/json" })
	@Produces(MediaType.APPLICATION_OCTET_STREAM)
	public Response exportAccount(@Context HttpServletRequest servletRequest,
			@Context HttpServletResponse servletResponse,
			@QueryParam("commID") String commID,
			@QueryParam("comm") String comm,
			@QueryParam("apartmentType") String apartmentType,
			@QueryParam("searchType") String searchType,
			@QueryParam("search") String search,
			@QueryParam("startTime") String startTime) throws Exception;

	@GET
	@Path("sumInfos")
	@Produces({ "application/json" })
	public Response getSumAccountInfo(
			@Context HttpServletRequest servletRequest,
			@QueryParam("commID") String commID,
			@QueryParam("apartmentType") String apartmentType,
			@QueryParam("searchType") String searchType,
			@QueryParam("search") String search,
			@QueryParam("startTime") String startTime) throws Exception;

	/***
	 * 导出日志
	 * 
	 * @param servletRequest
	 * @param servletResponse
	 * @param accountID
	 * @param operation
	 * @param logType
	 * @param search
	 * @return
	 * @throws Exception
	 */
	@GET
	@Path("{accountID}/exportlogs")
	@Consumes({ "application/json" })
	@Produces(MediaType.APPLICATION_OCTET_STREAM)
	public Response exportAccountLogs(
			@Context HttpServletRequest servletRequest,
			@Context HttpServletResponse servletResponse,

			@PathParam("accountID") String accountID,
			@QueryParam("commID") String commID,
			@QueryParam("apartmentID") String apartmentID,
			@QueryParam("operation") String operation,
			@QueryParam("logType") String logType,
			@QueryParam("search") String search) throws Exception;

}
